Vehicle File Import
Introduction
This will import vehicle file to Cloud SQL for PostgreSQL
Fields
Column Position | Description | Datatype | Validation | Max length | Mandatory | Example |
A | Vehicle Reg Number | String | A-Z and 0-9 & All Special Char | 10 | Y | ABC123 |
B | Vehicle Id | Number | 0-9 | 5 | Y | 1 |
C | VIN | String | A-Z and 0-9 | 17 | Y | ABC2D4GHY47524999 |
Importing Vehicle Files
This process imports vehicle registration files from Modulus into database. Modulus provides separate vehicle registration files for Peugeot and Citroen brands.
Step 1: Preparation
Before importing new vehicle data, you need to clear existing data and prepare the files:
1.1 Clear Existing Data
- Truncate the existing data in the
modulus_vehicle
table
1.2 Prepare Import Files
- You will receive two separate files from Modulus:
- One for Peugeot vehicles
- One for Citroen vehicles
- Important: Import both files one after the other (not simultaneously)
1.3 Upload Files to Storage
- Upload each file to the Google Cloud Storage bucket:
fnp-imports/modulus
- Required filename:
vehicle_reg.csv
(rename each file to this exact name before uploading) - Process one brand at a time
Step 2: File Validation (Optional)
- Navigate to Cloud Scheduler
- Locate and run the Modulus_vehicle_file_validation job
- Note: Job name may vary slightly in different environments
- Wait for validation to complete successfully before proceeding
Step 3: Import Process
- In the same Cloud Scheduler console
- Locate and run the Modulus_vehicle_file_import job
- Note: Job name may vary slightly in different environments
- Monitor the import job for completion
Step 4: Repeat for Second Brand
After successfully importing the first brand's file:
- Upload the second brand's file (rename to
vehicle_reg.csv
) - Repeat Step for the second file
- Ensure both Peugeot and Citroen data are imported
Troubleshooting Memory Issues
⚠️ Memory Error Handling:
If you encounter a memory error like
Memory limit of 512 MiB exceeded with 515 MiB used
, follow these steps:
- Increase the memory allocation for the import service (above 512MB)
- Re-run the import job
- Revert the memory back to default (512MB) after successful import
Testing
- Data will be inserted to Cloud SQL for PostgreSQL under
fpn
database in tablemodulus_vehicle
.
Status: Accepted
Category: Protected
Authored By: Gladson on Jan 5, 2024
Revisions